#include "curve_modify.h"
#include "ksququ.h"

#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

void main(int argc, char **argv)
{
    int16_t parm = 2400, input = 0, parm_default = 2400;
    int16_t output = 0;
    int16_t i = 0;
    if (argc > 1) {
        parm_default = atoi(argv[1]);
    }

    //    for( i = 0; i < 100; i++ ) {
    //        output = curve_modify_loop(10*i + parm);
    //        printf("%d %d %d\r\n", (10*i + parm), output, cbset.bset_per);
    //    }
    parm = parm_default;
    for (i = 0; i < 300; i++) {
        input = (rand() % 200) - 100 + parm - 5 * i;
        //output = curve_modify_loop(input);
        output = scale_up(input);
        printf("%04d %04d %d %d\r\n", input, output, oxy_optimized.output , oxy_optimized.rcnt);
    }
   parm = input;
   for (i = 0; i < 600; i++) {
        input = (rand() % 200) - 100 + parm + 5 * i;
        //output = curve_modify_loop(input);
        output = scale_up(input);
        printf("%04d %04d %d %d\r\n", input, output, oxy_optimized.output , oxy_optimized.rcnt);
    }

      parm = input;
    for (i = 0; i < 600; i++) {
        input = (rand() % 200) - 100 + parm - 5 * i;
        //output = curve_modify_loop(input);
        output = scale_up(input);
        printf("%04d %04d %d %d\r\n", input, output, oxy_optimized.output , oxy_optimized.rcnt);
    }

}
